<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>test</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="icon" href="../images/favicon.ico">
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <style>

    </style>
</head>
<body style="margin: 0 auto;padding: 0;">
<div style="height: 50px;line-height: 50px;background: #1E9FFF;margin:0 auto;padding:0;color:#fff;text-align: center;">Test</div>
<div id="appContainVue" class="layui-form layuimini-form">
    <div class="container-floud">
        <div style="text-align: left;padding:10px 30px;">
            <div style="padding:10px 0px;">请求数据</div>
            <div><textarea id="requestData" name="requestData" placeholder="请求数据" style="height: 100px;width: 100%;">{}</textarea></div>
            <div style="padding:10px 0px;">返回数据</div>
            <div><textarea id="resultData" name="resultData" placeholder="返回数据" style="height: 100px;width: 100%;"></textarea></div>
            <div style="text-align: center;padding-top:20px;">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">提交</button>
            </div>
        </div>
    </div>
</div>
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="../js/lay-config.js?v=2.0.0" charset="utf-8"></script>
<script src="../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="../js/crypto-js.min.js"></script>
<script src="../api/util.js?" charset="utf-8"></script>
<script src="../api/request.js?" charset="utf-8"></script>
<!-- import Vue before Element -->
<script src="../js/vue.js"></script>
<!-- import JavaScript -->
<script src="../lib/element-ui/lib/index.js"></script>
<script>
    layui.use(['form', 'tableSelect', 'layedit', 'laydate'], function () {
        let form = layui.form,
            layer = layui.layer,
            $ = layui.$;
        //监听提交
        form.on('submit(saveBtn)', function (data) {
            var params = data.field;
            let _loading = layer.load(2, {shade: [0.5, '#fff']});
            request.otherGetMethod('common','curlTest?', params, function (result) {
                if (_loading != undefined) {
                    layer.close(_loading);
                }
                if (result.code == 0) {
                    $("#resultData").val(JSON.stringify(result.data));
                    $("#resultData").text(JSON.stringify(result.data));

                }
            });

            return false;
        });
    });
</script>
</body>
</html>